﻿@model DauGiaApp.Models.SanPham

@{
    ViewBag.Title = "ChiTiet";
}
<link href="@Url.Content("~/Content/chitietsanpham.css")" rel="stylesheet" type="text/css" />
<link href="../../Content/spcungloai.css" rel="stylesheet" type="text/css" />
<link href="../../Scripts/jquery-lightbox-0.5/css/jquery.lightbox-0.5.css" rel="stylesheet" type="text/css" />
<script src="../../Scripts/jquery-1.6.js" type="text/javascript"></script>
<script src="../../Scripts/D4Scripts/d4script.js" type="text/javascript"></script>
<script type="text/javascript" src="../../Scripts/jquery-lightbox-0.5/js/jquery.lightbox-0.5.js"></script>

<script type="text/javascript">
    $(function () {
        $('#dsanh a').lightBox(); // Select all links in the page
        // ... The possibility are many. Use your creative or choose one in the examples above
    });
   
</script>
<h2 class="title_hot">Chi tiết sản phẩm</h2>
<div class="item_chitietsanpham">    
    <div id = "hinhanh">
        
        <span id="anhsanpham">
            <a href="../../Content/images/@Model.LayAnhDaiDien()" >
              <img src="../../Content/images/@Model.LayAnhDaiDien()" alt="anh sp"/>
            </a>	    
        </span> 
        
        <span id = "chitietsanpham">
            <!-- thông tin chi tiết -->
            <h1 id="nguoidang">Người đăng : @Model.TaiKhoan.TenTaiKhoan</h1>
            <h1 id= "gia">Giá : @Model.GiaHienTai VNĐ</h1>
            <h1 id "ngaydang">Ngày đăng : @Model.NgayDang.ToString()</h1>
            <h1 id "tinhtrang">Tình trạng : @Model.TinhTrangSanPham.TenTinhTrangSanPham</h1>        
            <a href="#">   <img class="bid_btn" src="../../Content/images/bid_btn.jpg" alt="khoi di"/> </a>	
        </span>
        <div id = "dsanh">
        <!-- danh sách ảnh -->            
            <ul>                    
            @foreach (string item in Model.LayDSAnh())
            {            
		        <li>
                <a href="../../Uploads/@item"><img src="../../Uploads/@item" alt="@item" /></a>
                </li>
            }                
            </ul>                
        </div>        
    </div>

     

    <div id = "motasanpham">
        <h1 id = "tensanpam"> @Model.LoaiSanPham.TenLoaiSanPham @Model.TenSanPham</h1>
        <div id="mo-ta-sp">@Html.Raw(Model.MoTaSanPham)</div>
    </div>
    
    <div id="spcungloai">
        <div id="lb-spcungloai">Sản phẩm cùng loại đang đấu giá</div>
        @{
            List<DauGiaApp.Models.SanPham> lscl = Model.LaySPCungLoaiDangDG();
         }
         @foreach (DauGiaApp.Models.SanPham sp in lscl)
         {
             <div class="item_sanpham_cl">        
	            <h1 class="item_tensp_cl"><a href="ChiTiet?id=@sp.MaSanPham">@sp.TenSanPham</a></h1>
                <div class="khunganh_cl">
	                <img class="anhdaihien_cl" src="../../Content/images/@sp.LayAnhDaiDien()" alt="anh" />
                </div>
	            <h1 class="item_giahientai_cl">Giá hiện tại: @sp.GiaHienTai VNĐ </h1>	        
	            <h1 class="item_giakhoidiem_cl">Giá khởi điểm: @sp.GiaKhoiDiem VNĐ</h1>	    
            </div>
         }
    </div>
    <div id="sp_comment">
    @foreach (DauGiaApp.Models.Comment comment in Model.LayDanhSachComment())
    {
        <div class="sp_item_comment">
        <h1 class="title_sp_item_comment">@comment.TaiKhoan.TenTaiKhoan</h1>
        <p class="content_sp_item_comment">@comment.NoiDungComment</p>
        </div>
    }
   
   <form id="form-dang-comment">
        <div id="loader" style="display: none;">                
                <p>đang gởi comment...</p>
                <img src="../../Content/images/ajax-loader.gif" alt="loading..." />
        </div>
        <p>Nội dung comment:</p>
        <input type="hidden" name="masanpham" value="@Model.MaSanPham" />        
        <textarea id="txt" name="noidung_comment"></textarea>
    </form>
    <button  onclick="postComment();" id="btn">Gởi Comment</button>
    
    </div>
    <!-- test image zooom -->
    

</div>